import React from 'react';
import {render} from 'react-dom';
import {observer} from 'mobx-react';
import { observable } from 'mobx';

var timerDate = observable({
    secondsPassed:0
});

setInterval(() => {
    timerDate.secondsPassed++;
},1000);

@observer class Timer extends React.Component {
    render(){
        return (<span>Seconds passed:{this.props.timerDate.secondsPassed}</span>)
    }
};

render(<Timer timerDate={timerDate} />,document.getElementById('root'));